﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication2
{
    public partial class TaskDetial : BasicPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            BasicPageInit();
            if (!IsPostBack)
            {
                var id = Request.QueryString["id"];

                if (!string.IsNullOrEmpty(id))
                {
                    var sql = string.Format("select * from Task where id = {0}",id);
                    var dt = DbHelper.GetData(sql);

                    var row = dt.Rows[0];

                    this.Id.Text = row["Id"].ToString();
                    this.txtTaskName.Text = row["TaskName"].ToString();
                    this.txtTaskContent.Text = row["TaskContent"].ToString();
                    this.CreateUser.Text = row["CreatedUserId"].ToString();
                    this.CreateTime.Text = row["Createtime"].ToString();
                }
            }
        }

        protected void Back_Click(object sender, EventArgs e)
        {
            Response.Redirect("Default.aspx");
        }
    }
}